Skip to content

feat(auth): ignore user cancel when session is expired on hostedui sign out #3956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 6, 2025

Conversation

harsh62
Copy link
Member

@harsh62 harsh62 commented Jan 31, 2025

#3943

Issue #

Description

Even if the user cancels the pop up to log out, continue to sign out locally.

NOTE: This happens only when the session is already expired.

Usecase: When the session is expired, and developer wants to trigger an auto logout, the pop up could prevent that from happening, if the user pressed cancel.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@harsh62 harsh62 requested a review from a team as a code owner January 31, 2025 18:56
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 69.31818% with 27 lines in your changes missing coverage. Please review.

Project coverage is 67.67%. Comparing base (b0f9183) to head (7fba1a7).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ions/Helpers/FetchAuthSessionOperationHelper.swift 56.09% 18 Missing ⚠️
...toAuthPlugin/Actions/SignOut/InitiateSignOut.swift 75.86% 7 Missing ⚠️
...thPlugin/Actions/SignOut/ShowHostedUISignOut.swift 75.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3956   +/-   ##
=======================================
  Coverage   67.67%   67.67%           
=======================================
  Files        1128     1128           
  Lines       52252    52329   +77     
=======================================
+ Hits        35359    35412   +53     
- Misses      16893    16917   +24     
Flag Coverage Δ
API_plugin_unit_test 70.09% <ø> (-0.24%) ⬇️
AWSPluginsCore 69.34% <ø> (ø)
Amplify 47.83% <ø> (+0.01%) ⬆️
Analytics_plugin_unit_test 85.20% <ø> (ø)
Auth_plugin_unit_test 73.69% <69.31%> (+0.09%) ⬆️
DataStore_plugin_unit_test 83.27% <ø> (-0.10%) ⬇️
Geo_plugin_unit_test 74.86% <ø> (ø)
Logging_plugin_unit_test 63.11% <ø> (ø)
Predictions_plugin_unit_test 35.40% <ø> (ø)
PushNotifications_plugin_unit_test 88.43% <ø> (ø)
Storage_plugin_unit_test 76.87% <ø> (ø)
unit_tests 67.67% <69.31%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

thisisabhash
thisisabhash previously approved these changes Feb 5, 2025
@thisisabhash
Copy link
Member

thisisabhash commented Feb 5, 2025

Can you add a detailed description of the changes for future reference?

thisisabhash
thisisabhash previously approved these changes May 5, 2025
@harsh62 harsh62 merged commit 540f1f2 into main May 6, 2025
271 of 278 checks passed
@harsh62 harsh62 deleted the hosted-ui-logout-ignore-user-cancel branch May 6, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants